package com.service;

import com.bean.User;
import com.dao.UserDao;

import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collection;
import java.util.List;

/**
 * Created by Administrator on 2016/9/10.
 */
@Service
public class UserService {
    @Autowired
    private UserDao userDao;

    public User getUser(User user) {
       List<User> users= userDao.getUserById(user);
       if (CollectionUtils.isNotEmpty(users)){
         return   users.get(0);
       }


       return null;
    }
}
